package com.controller.admin;

import com.bean.entity.TestInfo;
import com.bean.pojo.Dto;
import com.bean.util.DtoUtil;
import com.service.TestInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("admin")
public class AdminController {

    @Autowired
    private TestInfoService testInfoService;

    @RequestMapping("queryTestInfo")
    public Dto queryTestInfo(){
        System.out.println(">>>升学率>>>获取考试信息");

        try {
            List<TestInfo> testInfoList = testInfoService.query(new TestInfo());
            return DtoUtil.returnSuccess(testInfoList);
        } catch (Exception e) {
            e.printStackTrace();
            return DtoUtil.returnFail(e.getMessage());
        }
    }

}
